﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NewRen.Models.ViewModel
{
    public class vExchangeCode
    {
        public int ID { get; set; }

        public string Code { get; set; }

        public int ProductID { get; set; }

        public string ProductName { get; set; }

        public int UserID { get; set; }

        public string UserName { get; set; }

        public DateTime Time { get; set; }

        public bool IsExchange { get; set; }

        public DateTime? ChangeTime { set; get; }

        public vExchangeCode() { }

        public vExchangeCode(ExchangeCode model)
        {
            this.ID = model.ID;
            this.Code = model.Code;
            this.ProductID = model.ProductID;
            this.ProductName = model.Product.ProductName;
            this.UserID = model.UserID;
            this.UserName = model.User.UserName;
            this.Time = model.Time;
            this.IsExchange = model.IsExchange;
            this.ChangeTime = model.ChangeTime;
        }
    }
}
